<%-- 
    Document   : updateMessage
    Created on : 2017-2-22, 21:03:41
    Author     : DELL
--%>
<%@page import="lookMessage.LookMessageBean" %>
<%@page import="java.util.ArrayList" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>个人信息管理——修改个人信息页面</title>
    </head>
    <body>
        <hr noshade>
        <div align="center">
            <table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
                <tr>
                    <td width="33%">
                        修改个人信息
                    </td>
                    <td width="33%">
                         <a href="http://localhost:8081/PersonInforMSys/lookMessage/lookMessage.jsp">查看个人信息</a>
                    </td> 
                    <td width="33%">
                        <a href="http://localhost:8081/PersonInforMSys/lookMessage/updatePassword.jsp">修改密码</a>
                    </td>                  
                </tr>
            </table>
        </div>

        <hr noshade>
        <br><br>
        <form action="http://localhost:8081/PersonInforMSys/UpdateMessageServlet" method="post">
 <table width="52%" align="center" border="2" cellspacing="0" cellpadding="0" bgcolor="gray" >
            <%
                String name = null;
                String sex = null;
                String birth = null;
                String nation = null;
                String edu = null;
                String phone = null;
                String addr = null;
                String email = null;
                ArrayList al = (ArrayList) session.getAttribute("wordlist");
                if (al== null || al.size() == 0) {

                    response.sendRedirect("http://localhost:8081/PersonInforMSys/main/bottom.jsp");
                } else {
                    for (int i = al.size() - 1; i >= 0; i--) {

                        LookMessageBean mbean = (LookMessageBean) al.get(i);
                        name = mbean.getName();
                        sex = mbean.getSex();
                        birth = mbean.getBirth();
                        nation = mbean.getNation();
                        edu = mbean.getEdu();
                        phone = mbean.getPhone();
                        addr = mbean.getAddr();
                        email = mbean.getEmail();
                    }
                }
            %>

            <tr align="left">
                <td height="30">用户姓名</td>
                <td>
                    <input type="text" name="name" value="<%=name%>">  
                </td>
            </tr>
            <tr align="left">
                <td height="30">用户性别</td>
                <td><%=sex%> </td>                
            </tr>
            <tr align="left">
                <td height="30">出生日期</td>
                <td><%=birth%> </td>                
            </tr>
            <tr align="left">
                <td height="30">用户民族</td>
                <td>
                     <select name="nation" size="1">
                        <% if(nation.equals("汉族")){ %>
                        <option value="汉族" selected>汉族</option>
                        <%}else{%>
                         <option value="汉族" >汉族</option>
                         <%}%>
                   <% if(nation.equals("回族")){ %>
                        <option value="回族" selected>回族</option>
                        <%}else{%>
                         <option value="回族" >回族</option>
                         <%}%>
                        <% if(nation.equals("壮族")){ %>
                        <option value="壮族" selected>壮族</option>
                        <%}else{%>
                         <option value="壮族" >壮族</option>
                         <%}%>
                        <% if(nation.equals("其它")){ %>
                        <option value="其它" selected>其它</option>
                        <%}else{%>
                         <option value="其它" >其它</option>
                         <%}%>
             
                     </select>
                    <%=nation%> 
                </td>                
            </tr>
            <tr align="left">
                <td height="30">用户学历</td>
                <td>
                    <select name="edu" size="1">
                        <% if(edu.equals("博士")){ %>
                        <option value="博士" selected>博士</option>
                        <%}else{%>
                         <option value="博士" >博士</option>
                         <%}%>
                                                 <% if(edu.equals("硕士")){ %>
                        <option value="硕士" selected>硕士</option>
                        <%}else{%>
                         <option value="硕士" >硕士</option>
                         <%}%>
                        <% if(edu.equals("本科")){ %>
                        <option value="本科" selected>本科</option>
                        <%}else{%>
                         <option value="本科" >本科</option>
                         <%}%>
                        <% if(edu.equals("高中")){ %>
                        <option value="高中" selected>高中</option>
                        <%}else{%>
                         <option value="高中" >高中</option>
                         <%}%>
                        <% if(edu.equals("初中")){ %>
                        <option value="初中" selected>初中</option>
                        <%}else{%>
                         <option value="初中" >初中</option>
                         <%}%>                         
                        <% if(edu.equals("小学")){ %>
                        <option value="小学" selected>小学</option>
                        <%}else{%>
                         <option value="小学" >小学</option>
                         <%}%> 
                        <% if(edu.equals("其它")){ %>
                        <option value="其它" selected>其它</option>
                        <%}else{%>
                         <option value="其它" >其它</option>
                         <%}%>                          
                    </select>
                </td>  
                
            </tr>            
            <tr align="left">
                <td height="30">用户电话</td>
                <td align="left">
                    <input type="text" name="phone" value=" <%=phone%> ">
                    
                </td>                
            </tr>    
            <tr align="left">
                <td height="30">用户地址</td>
                <td><%=addr%> </td>                
            </tr>
            <tr align="left">
                <td height="30">用户邮箱</td>
          
                  <td  align="left">
                    <input type="text" name="email" value=" <%=email%> ">
                    
                </td>  
            </tr>
        <tr  >
            <td height="30" align="center" colspan="2">
                
                <input type="submit" value="确定" size="12">&nbsp;&nbsp;&nbsp;
                     <input type="reset" value="取消" size="12">
                </td>

            </tr>
        </form>
    </body>
</html>
